/* 
 * File:   Device.hpp
 * Author: Aaron
 *
 * Created on 20. Februar 2011, 11:15
 */

#ifndef DEVICE_HPP
#define	DEVICE_HPP


// -- Includes
#include "Types.hpp"
#include "Platform.hpp"


// -- Forward declaration of class 'Device' in header 'cl.hpp'.
//    'cl.hpp' is the C++ binding header of OpenCL and can be downloaded
//    from http://www.khronos.org.
namespace cl
{
    class Device;
}


/**
 * Contains wrapper classes for using OpenCL on the local machine.
 */
namespace OpenCLWrapping
{
    /**
     * Represents an OpenCL device
     */
    class Device
    {
        public:
            // -- Public Constructors & Destructors
            Device(const Device& _orig);
            virtual ~Device();

            // -- Public Methods
            Device& operator=(const Device& _other);
            /**
             * Retrieves the name of this device.
             * @return A string which represents the name of this device.
             */
            string getName() const;
            /**
             * Retrieves the device's highest supported OpenCL version.
             * @return A string which represents the version.
             */
            string getDeviceVersion() const;
            /**
             * Retrieves the device complier's highest supported OpenCL C
             *      version.
             * @return A string which represents the version.
             */
            string getCLVersion() const;
            /**
             * Retrieves the number of compute units. A compute unit is usually
             *      a processor core.
             * @return An integer which represents the number of compute units.
             */
            uint32 getComputeUnits() const;
            /**
             * Retrieves the clock frequency of the device in MHz.
             * @return An integer which represents the clock frequency in MHz.
             */
            uint32 getClockFrequency() const;
            /**
             * Retrieves the size of the global memory in bytes.
             * @return An integer of 64 bit which represents the size of the
             *      global memory in bytes.
             */
            uint64 getGlobalMemorySize() const;

        private:
            // -- Private Constructors
            Device(const cl::Device& _impl);

            // -- Private Methods
            cl::Device* getImpl();
            const cl::Device* getImpl() const;

            // -- Members
            cl::Device* m_Impl;
            

        // -- Friends
        friend class Platform;
    };
}
#endif	/* DEVICE_HPP */

